#ifndef SIMULACAO_H
#define	SIMULACAO_H

#include "stdafx.h"
#include "amostraExponencial.h"

#include "boost/unordered_map.hpp"

class Simulacao {
    
public:    
    Simulacao(double l, unsigned int b, double tPS, double tP, double g, unsigned int m_n0, bool m_p)
            : lambda(l), blocos(b), taxaPeerSeed(tPS), taxaPublisher(tP), gamma(g), n0(m_n0), p(m_p) {
                
                rodadaAtual = 1;
                this->run();
            }
    virtual ~Simulacao();
    void run ();
    void setEvento (EVENTO ev);
    
private:
    double lambda;
    unsigned int blocos;
    double taxaPeerSeed;
    double taxaPublisher;
    double gamma;
    unsigned int n0;
    bool p;

    std::list<EVENTO> listaEventos;
    std::list<P_Peer> globalPeers;
    boost::unordered_map<int, int> disponibilidadeBlocos;
    unsigned int rodadaAtual;
    
    double sumAmostras;
    double mediaAmostras; //sumAmostras/n
    double varianciaAmostras;
    double sumAmostrasQuadrado;
};

#endif	/* SIMULACAO_H */

